]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Handle Escape key to cancel ongoing verification
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Mon, 1 Feb 2021 11:52:01 +0000 (12:52 +0100)
committerMarge Bot <marge-bot@gnome.org>
Fri, 12 Feb 2021 20:26:00 +0000 (20:26 +0000)
Escape key is supposed to cancel a verification, however if the user
already hit Enter to begin the authentication the Escape key won't work
until the verification completed.

This may be quite inconvenient when an user did a typo while writing and
wants to cancel the already started auth.

So, while authenticating (or in general while the entry is unsensitive)
give the key focus to the authpromt itself so that we can still get the
input events and cancel an user action.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1622>

js/gdm/authPrompt.js

index 43798b3b4b7c747be0f515d06cd4e91f808543db..dcc1d3f2893d53a23b94c7862aeb11a49de16054 100644 (file)
@@ -432,10 +432,14 @@ var AuthPrompt = GObject.registerClass({
 
         this._entry.reactive = sensitive;
 
-        if (sensitive)
+        if (sensitive) {
             this._entry.grab_key_focus();
-        else if (this._entry === this._passwordEntry)
-            this._entry.password_visible = false;
+        } else {
+            this.grab_key_focus();
+
+            if (this._entry === this._passwordEntry)
+                this._entry.password_visible = false;
+        }
     }
 
     vfunc_hide() {